package cn.medemede.k1;

public class Circle extends Shape {

    double r;

    Circle() {
        name="圆形";
    }

    @Override
    public double area() {
        return PI*r*r;
    }

    @Override
    public double perimeter() {
        return PI*r*2;
    }

    Circle(double r) {
        name="圆形";
        this.r = r;
    }

    @Override
    public String toString() {
        return "Circle{" +
                "r=" + r +
                ", name='" + name + '\'' +
                '}';
    }
}
